package com.scape.core.model;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.json.RooJson;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.Basic;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@RooJavaBean
@RooToString
@RooEntity
@RooJson(deepSerialize = true)
public class Document 
{

	private static final Log log = LogFactory.getLog(Document.class);
	public static final String SAVE_PATH = "\\dev\\images\\";


    @Size(max = 30)
    private String name; 

    @Size(max = 80)
    private String description;

    private String filename;

    @NotNull
    @Lob
    @Basic(fetch = FetchType.LAZY)
    private byte[] content;

     private String contentType;

    private Long blobSize;
    
    @Transient
    @Size(max = 100)
    private String url;
    
 	
}
